package com.baseproject.util;

/**
 * Created by hp on 2017/6/19.
 */

public class UserUtil {

    public static String getCode(Throwable e) {
        if (null == e || null == e.getMessage()) {
            LogUtils.e("error params! no message, e = " + e);
            return null;
        }
        String[] message = e.getMessage().split(",");
        if (message.length == 2) {
            String code = message[0];
            return code;
        } else {
            LogUtils.e("error params! message length error, e = " + e);
            return null;
        }
    }

}
